package org.achao.controller;

import org.achao.server.WebSocketDemoServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author achao
 * @description websocket 控制层
 * @date 2023/10/2 15:06
 */
@RestController
@RequestMapping("/websocket")
public class WebSocketController {

    @Autowired
    private WebSocketDemoServer server;

    @GetMapping("/sendAll")
    public String sendMsgAll() {
        server.sendMessageAll();
        return "ok";
    }
}
